package com.jr.mapper;

import com.jr.pojo.Order;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.ArrayList;

@Component
public interface OrderMapper {

    int insertOrder(Order order);

    ArrayList<Order> selectByUserId(@Param("userId") Integer userId, @Param("userType") String userType);

    Order selectById(@Param("orderId") Integer orderId);

    int updateStatus(@Param("orderId") Integer orderId, @Param("status") String status);

    ArrayList<Order> selectByPage(@Param("userId") Integer userId, @Param("userType") String userType, @Param("offset") int offset, @Param("pageSize") int pageSize);

    ArrayList<Order> selectByPageWithStatus(@Param("userId") Integer userId, @Param("userType") String userType, @Param("offset") int offset, @Param("pageSize") int pageSize, @Param("status") String status);

    int countByUserId(@Param("userId") Integer userId, @Param("userType") String userType);

    int countByUserIdWithStatus(@Param("userId") Integer userId, @Param("userType") String userType, @Param("status") String status);
}
